const Koa = require('koa');
const koaBody = require('koa-body')
const router = require('./routes')
const app = new Koa();
const path = require('path')
const static = require('koa-static')(path.resolve(__dirname, 'public'))
require('./utils/mongoose')

app.use(koaBody())
app.use(static)
app.use(router.routes())

app.listen(3000, () => {
  console.log('server is running, port: 3000');
});